package com.demo.study.algorithm.leetcode.array.easy;

/**
 * LT27
 * <a href="https://leetcode.cn/problems/remove-element/">移除元素</a>
 *
 * @author Baymax
 * @since 2024-11-17
 */
public class LT27 {

    public int removeElement(int[] nums, int val) {
        int point = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != val) {
                nums[point] = nums[i];
                point++;
            }
        }
        return point;
    }

}
